<template>
    <view class="page bg-fff">
        <view class="topWrap">
            <image class="topImg heightAuto" src="https://image.srea.org.cn/xcx/query-tools-top-bg.jpg" mode="widthFix"></image>
            <!-- <view class="title col-fff fontBold">一键查询</view> -->
        </view>

        <view class="menusWrap bg-fff">
            <view class="menuBtn" v-for="(item,index) in menuList" :key="index" @click="navRoute(item)">
                <image class="menuImg heightAuto" :src="item.icon" mode="widthFix"></image>
            </view>
        </view>

        <up-gap height="40"></up-gap>
    </view>
</template>

<script setup>
import { ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { useIndexStore } from '@/store/index';
import { findHomeAPI, loadAllProducts } from '@/common/api/houses';

const indexStore = useIndexStore();

const menuList = ref([
    {
        title: '购房积分',
        type: 'jiFen',
        path: '/pages/tools/integral-query/integral-query',
        icon: 'https://image.srea.org.cn/xcx/icon-query-tools-menu-jifen-bg-2.png',
    },
    // {
    //     title: '购房资格',
    //     type: 'zife',
    //     path: '/pages/tools/purchase/identity',
    //     icon: 'https://image.srea.org.cn/xcx/icon-query-tools-menu-zige-bg-1.png',
    // },
    {
        title: '居住证积分',
        type: 'juZhuZheng',
        path: '/pages/tools/residence-permit/integral-query',
        icon: 'https://image.srea.org.cn/xcx/icon-query-tools-menu-juzhuzheng-bg-1.png',
    },
    {
        title: '房贷计算器',
        type: 'fangDai',
        path: '/pages/tools/calculator/mortgage-calculate',
        icon: 'https://image.srea.org.cn/xcx/icon-query-tools-menu-fangdai-bg-1.png',
    },
    {
        title: '公积金额度',
        type: 'gongJiJin',
        path: '/pages/tools/calculator/accumulate-limit-query',
        icon: 'https://image.srea.org.cn/xcx/icon-query-tools-menu-gongjijin-bg-1.png',
    },
    {
        title: '税费计算',
        type: 'shuiFei',
        path: '/pages/tools/calculator/tax-query',
        icon: 'https://image.srea.org.cn/xcx/icon-query-tools-menu-shuifei-bg-1.png',
    },
    {
        title: '征信打印网点',
        type: 'wangDian',
        path: '/pages/tools/zheng-xin/wang-dian',
        icon: 'https://image.srea.org.cn/xcx/icon-query-tools-menu-zhengxin-wangdian-bg-1.png',
    },
    {
        title: '查询征信报告',
        type: 'baoGao',
        path: '/pages/tools/zheng-xin/bao-gao',
        icon: 'https://image.srea.org.cn/xcx/icon-query-tools-menu-zhengxin-baogao-bg-1.png',
    }
]);

// 初始化加载数据
onLoad((options) => {
	uni.$check_and_login()
});


//点击Navs
function navRoute(info){
    uni.navigateTo({
        url: `${info.path}?pageType=${info.type}&type=${info.type}`
    })
}
</script>

<style lang="scss" scoped>
.page {
    min-height: 100vh;
    .topWrap{
        position: relative;
        .topImg{
            width: 100%;
        }
        .title{
            position: absolute;
            top: 90rpx;
            right: 70rpx;
            font-size: 50rpx;
        }
    }
    
    .menusWrap{
        position: relative;
        z-index: 1;
        margin: -100rpx 0 0 0;
        padding: 60rpx 50rpx;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 50rpx;
        border-radius: 40rpx;
        
        .menuBtn{
            width: 100%;
            
            &:first-child {
                grid-column: 1 / -1; // 让第一个元素跨越所有列
            }
            
            .menuImg{
                width: 100%;
                border-radius: 40rpx;
                box-shadow: 28rpx 28rpx 28rpx -28rpx rgba(0,0,0,.36);
            }
        }
    }
}
</style>